
user = "xiaoming"
passwd = "123456"
bar = '''
1、查看信息
2、编辑信息
3、退出
'''
def login_check(func):
    def inner():
        with open("login.txt", "r+") as f:
            if f.read() == "1":
                func()
                return None
        print("未登录，请先进行登录")
        input_user,input_passwd = input("请输入你的账号："),input("请输入你的密码：")
        if input_user == user and input_passwd == passwd:
            with open("login.txt", "r+") as f:
                f.write("1")
            func()
    return inner


def select_info():
    print('金币：10000')
    print('等级：30')

@login_check
def update_info():
    print('修改信息')

while True:
    print(bar)
    result = input('请输入你的操作指令：')
    if result == "1":
        select_info()
    elif result == "2":
        update_info()
    elif result == "3":
        with open("login.txt", "w+") as f:
            f.write("0")
        break